﻿namespace CSharpPro._0929;

public class Demo
{
    static void Main()
    {
        Console.WriteLine("1000以内的水仙花数有：");
        
        for (int i = 100; i < 1000; i++)
        {
            int hundreds = i / 100;
            int tens = (i / 10) % 10;
            int units = i % 10;
            int sum = (int)(Math.Pow(hundreds, 3) + Math.Pow(tens, 3) + Math.Pow(units, 3));
            if (sum == i)
            {
                Console.WriteLine(i);
            }
        }
    }
}